﻿using System;
using System.Windows.Forms;

namespace APP.HELPER.Utils.CustomizeToolbox
{
    public class VnMessageBox
    {
        public static DialogResult Show(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName);
        }
        public static DialogResult Info(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
        }
        public static DialogResult Warning(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
        public static DialogResult Question(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
        public static DialogResult Error(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
        }
        public static DialogResult Confirm(string text)
        {
            return VnMessageBox.Show(text, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
        public static DialogResult Show(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.OK);
        }
        public static DialogResult Info(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
        }
        public static DialogResult Warning(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
        public static DialogResult Question(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
        public static DialogResult Error(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Hand);
        }
        public static DialogResult Confirm(string text, string caption)
        {
            return VnMessageBox.Show(text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(text, caption, buttons, MessageBoxIcon.None);
        }
        public static DialogResult Info(string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(text, caption, buttons, MessageBoxIcon.Asterisk);
        }
        public static DialogResult Warning(string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(text, caption, buttons, MessageBoxIcon.Exclamation);
        }
        public static DialogResult Question(string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(text, caption, buttons, MessageBoxIcon.Question);
        }
        public static DialogResult Error(string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(text, caption, buttons, MessageBoxIcon.Hand);
        }
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
        {
            return VnMessageBox.Show(text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
        }
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
        {
            return VnMessageBox.Show(text, caption, buttons, icon, defaultButton, (MessageBoxOptions)0);
        }
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
        {
            return VnMessageBox.Show(null, text, caption, buttons, icon, defaultButton, options);
        }
        public static DialogResult Show(IWin32Window owner, string text)
        {
            return VnMessageBox.Show(null, text, string.Empty);
        }
        public static DialogResult Show(IWin32Window owner, string text, string caption)
        {
            return VnMessageBox.Show(owner, text, caption, MessageBoxButtons.OK);
        }
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
        {
            return VnMessageBox.Show(owner, text, caption, buttons, MessageBoxIcon.None);
        }
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
        {
            return VnMessageBox.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
        }
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
        {
            return VnMessageBox.Show(owner, text, caption, buttons, icon, defaultButton, (MessageBoxOptions)0);
        }
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
        {
            CSysMsgBoxHook cSysMsgBoxHook = new CSysMsgBoxHook();
            cSysMsgBoxHook.HookDialog();
            DialogResult result = MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
            cSysMsgBoxHook.UnHookDialog();
            return result;
        }
    }
}
